package cn.tedu.csmall.product.controller;

import cn.tedu.csmall.product.pojo.dto.AttributeTemplateAddNewDTO;
import cn.tedu.csmall.product.service.IAttributeTemplateServrvice;
import cn.tedu.csmall.product.web.JsonResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

@RestController
@Valid
@Slf4j
@RequestMapping("/attribute-template")
@Api(tags = "2.添加属性模板")
public class AttributeTemplateController {
    @Autowired
    IAttributeTemplateServrvice servrvice;

    @PostMapping("/add-new")
    @ApiOperation("添加属性模板")

    public JsonResult addNew(@Valid AttributeTemplateAddNewDTO attributeTemplateAddNewDTO) {
        log.debug("传入传输：{}", attributeTemplateAddNewDTO);
        servrvice.addNew(attributeTemplateAddNewDTO);
        return JsonResult.ok();
    }
}
